import { post, get, _delete, put } from '@/lin/plugin/axios'

class chartCollection {
  static async addchartCollection(data) {
    const res = await post('v1/Acquisitioncard', data)
    return res
  }

  static async getDetail(id) {
    const res = await get(`v1/Acquisitioncard/${id}`)
    return res
  }

  static async editchartCollection(id) {
    const res = await get(`/v1/Acquisitioncard/${id}/confirm`)
    return res
  }

  static async deletechartCollection(id) {
    const res = await _delete(`v1/Acquisitioncard/${id}`)
    return res
  }

  static async getchartCollections({
    StartTime,
    EndTime,
    page,
    count,
    dwmc,
    bgateway_name,
    collector_name,
    collector_power,
    tresult,
    hresult,

    dwmc1,
    bgateway_name1,
    collector_name1,
    dwmc2,
    bgateway_name2,
    collector_name2,
    dwmc3,
    bgateway_name3,
    collector_name3,
    dwmc4,
    bgateway_name4,
    collector_name4,
  }) {
    const res = await get('v1/Acquisitioncard/page', {
      StartTime,
      EndTime,
      page,
      count,
      dwmc,
      bgateway_name,
      collector_name,
      collector_power,
      tresult,
      hresult,

      dwmc1,
      bgateway_name1,
      collector_name1,
      dwmc2,
      bgateway_name2,
      collector_name2,
      dwmc3,
      bgateway_name3,
      collector_name3,
      dwmc4,
      bgateway_name4,
      collector_name4,
    })
    return res
  }

  static async AllConfirmed() {
    const res = await get('v1/Acquisitioncard/AllConfirmed')
    return res
  }

  static async search({ keyword, StartTime, EndTime, page, count,dwmc,bgateway_name,collector_name, collector_power, tresult, hresult,dwmc1,
    bgateway_name1,
    collector_name1,
    dwmc2,
    bgateway_name2,
    collector_name2,
    dwmc3,
    bgateway_name3,
    collector_name3,
    dwmc4,
    bgateway_name4,
    collector_name4,}) {
    const res = await get('v1/Acquisitioncard/search', {
      keyword,
      StartTime,
      EndTime,
      page,
      count,
      dwmc,
      bgateway_name,
      collector_name,
      collector_power,
      tresult,
      hresult,

      dwmc1,
      bgateway_name1,
      collector_name1,
      dwmc2,
      bgateway_name2,
      collector_name2,
      dwmc3,
      bgateway_name3,
      collector_name3,
      dwmc4,
      bgateway_name4,
      collector_name4,
    })
    return res
  }

  static async maphumidity({
    id,
    StartTime,
    EndTime,
  }) {
    const res = await get(`v1/maphumidity/map/${id}`,{
      StartTime,
      EndTime,
    })
    return res
  }

  static async maptemperature({
    id,
    StartTime,
    EndTime,
  }) {
    const res = await get(`v1/maptemperature/map/${id}`,{
      StartTime,
      EndTime,
    })
    return res
  }
}

export default chartCollection
